﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ProjectBase.Core;
using ProjectBase.Core.Web;
using ProjectBase.Mvc;

using $prjsn$.Common;
using $prjsn$.Entity.Services.HowTos;

namespace $safeprojectname$.Restrictions
{
    [CLSCompliant(false)]
    public class ComplexEntityRenderHandler : ControlRenderHandler<ComplexEntity>
    {
        protected override void Handle(IVisualControl control, PreRenderControlEventArgs args
            , IEntityModel<ComplexEntity, IFilter> model)
        {
            if (!model.IsAction(Str.Actions.Detail, Str.Actions.New, Str.Actions.Edit))
            {
                return;
            }

            // TODO apply filters based on scurity 

            //var item = control as DefinitionListItem;
            //if (item.Is())
            //{
            //    args.UseReadOnly = true;
            //}

            //var box = control as TextOrInput;
            //if (box.Is())
            //{
            //    args.DoNotRender = true;
            //}
        }
    }
}
